import requests
from lxml import etree
url = 'http://www.baidu.com'
head = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"}
r = requests.get(url=url,headers=head)
r.encoding = r.apparent_encoding
neri = r.text
doc = etree.HTML(neri)
a = doc.xpath('//input[@id="su"]/@value')[0]
print(a)
print(type(a))
